import java.sql.*;

public class SQLiteJDBC
{
	
  public static void main( String args[] ) throws SQLException
  {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    System.out.println("testing");
    try {
      Class.forName("org.sqlite.JDBC");
      con = DriverManager.getConnection("jdbc:sqlite:/home/paul/programing/final-year/database/Player.sqlite");
    } catch ( Exception e ) {
      System.err.println( e.getClass().getName() + ": " + e.getMessage() );
      System.exit(0);
    }
    con.setAutoCommit(true);
    System.out.println("Opened database successfully");
    stmt = con.createStatement();
    stmt.executeUpdate("INSERT INTO player (name) VALUES ('vicki')");
    rs = stmt.executeQuery("SELECT * FROM player");
    while(rs.next())
    {
    	System.out.println(rs.getString("name"));
    }
  }
}